-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(app, api-client, react-api-client): add api-client method for protocol reanalysis #14878
Conversation
…analysis On the ODD, we need to trigger protocol reanalysis via a new `/protocols/{protocolId}/analyses` endpoint post request. This analysis should occur when a user sends confirms values on an RTP-containing protocol on the ODD.
…fault in ProtocolSetupParameters
app/src/atoms/InputField/index.tsx
Outdated
@@ -75,6 +75,7 @@ export interface InputFieldProps { | |||
| typeof TYPOGRAPHY.textAlignCenter | |||
/** small or medium input field height, relevant only */ | |||
size?: 'medium' | 'small' | |||
ref?: React.MutableRefObject<null> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake from merging in edge. I will fix
@@ -1,5 +1,5 @@ | |||
import * as React from 'react' | |||
import { KeyboardReact as Keyboard } from 'react-simple-keyboard' | |||
import Keyboard from 'react-simple-keyboard' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other keyboards use import { KeyboardReact as Keyboard } from 'react-simple-keyboard'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above. reverting...
const { createProtocolAnalysis } = useCreateProtocolAnalysisMutation( | ||
{}, | ||
protocolId, | ||
host | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change like below
export function useCreateProtocolAnalysisMutation(
protocolId: string | null,
hostOverride?: HostConfig | null,
options: UseCreateProtocolAnalysisMutationOptions | undefined = {}
): UseCreateProtocolMutationResult {
We don't need to pass {}
.
const { createProtocolAnalysis } = useCreateProtocolAnalysisMutation( | |
{}, | |
protocolId, | |
host | |
) | |
const { createProtocolAnalysis } = useCreateProtocolAnalysisMutation( | |
protocolId, | |
host | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smart. fixing that.
HostConfig, | ||
RunTimeParameterCreateData, | ||
} from '@opentrons/api-client' | ||
import { ProtocolAnalysisSummary } from '@opentrons/shared-data' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { ProtocolAnalysisSummary } from '@opentrons/shared-data' | |
import type { ProtocolAnalysisSummary } from '@opentrons/shared-data' |
import { | ||
UseMutationResult, | ||
UseMutationOptions, | ||
useMutation, | ||
UseMutateFunction, | ||
useQueryClient, | ||
} from 'react-query' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { | |
UseMutationResult, | |
UseMutationOptions, | |
useMutation, | |
UseMutateFunction, | |
useQueryClient, | |
} from 'react-query' | |
import { | |
useMutation, | |
useQueryClient, | |
} from 'react-query' | |
import type { | |
UseMutationResult, | |
UseMutationOptions, | |
UseMutateFunction, | |
} from 'react-query' |
> | ||
|
||
export function useCreateProtocolAnalysisMutation( | ||
options: UseCreateProtocolAnalysisMutationOptions = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see the above comment
|
||
import type { ResponsePromise } from '../request' | ||
import type { HostConfig } from '../types' | ||
import type { ProtocolAnalysisSummary } from '@opentrons/shared-data' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be higher
@@ -62,10 +70,10 @@ describe('ProtocolSetupParameters', () => { | |||
}) | |||
it('renders the other setting when boolean param is selected', () => { | |||
render(props) | |||
screen.getByText('Off') | |||
expect(screen.getAllByText('On')).toHaveLength(3) | |||
screen.debug() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed if there is no specific reason to keep this debug line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just an oversight, thanks
import type { | ||
UseMutationResult, | ||
UseMutationOptions, | ||
UseMutateFunction, | ||
} from 'react-query' | ||
import { createProtocolAnalysis } from '@opentrons/api-client' | ||
import { useHost } from '../api' | ||
import type { AxiosError } from 'axios' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import type { | |
UseMutationResult, | |
UseMutationOptions, | |
UseMutateFunction, | |
} from 'react-query' | |
import { createProtocolAnalysis } from '@opentrons/api-client' | |
import { useHost } from '../api' | |
import type { AxiosError } from 'axios' | |
import { createProtocolAnalysis } from '@opentrons/api-client' | |
import { useHost } from '../api' | |
import type { AxiosError } from 'axios' | |
import type { | |
UseMutationResult, | |
UseMutationOptions, | |
UseMutateFunction, | |
} from 'react-query' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will reorder according to this pattern
response.data | ||
) | ||
) | ||
.catch(e => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
.catch(e => { | |
.catch((e: Error) => { |
}) | ||
return response.data | ||
}) | ||
.catch(e => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
.catch(e => { | |
.catch((e: Error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments but the changes look good.
I tested this branch on a Flex and this worked as expected.
closes AUTH-118
Overview
On the ODD, we need to trigger protocol reanalysis via a new
/protocols/{protocolId}/analyses
endpoint post request. This analysis should occur when a user sends confirms values on an RTP-containing protocol on the ODD.reference: robot server PR
Test Plan
Changelog
Review requests
protocol authorship devs
Risk assessment
medium